<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "" "">
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:w="http://www.apusic.com/jsf/widget" xmlns:layout="http://www.apusic.com/jsf/layout"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:ajax="http://www.apusic.com/jsf/ajax"
	xmlns:om="http://www.apusic.com/jsf/misc" renderKitId="AJAX" xmlns:epm="http://www.bp.com.cn/epm">
	<w:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<w:stylesheet src="/css/kmp4.css" type="text/css"></w:stylesheet>
		<w:script src="/javascript/k4.js" type="text/javascript" language="UTF-8"></w:script>
		<script>
		 	//<![CDATA[
		 	function deleteConfirm(){
			if(centralUnitGridJsvar.getSelectionModel().getSelected() == null){
				alert("请选择一条记录！");
				return false;
			}
			return showConfirm('你确定要删除吗？');
		   }
			function freshme(){
	 		var store=centralUnitGridJsvar.getStore();
			store.reload(store.lastOptions);
	 	   }	
	 	   function clearSeach(){
	 	   codeJsavr.setValue('');
	 	   unitNameJsvar.setValue('');
	 	   }
		     //]]>
		 </script>
	</w:head>
	<w:page title="机构一览">
		<layout:panel border="false" autoHeight="true" autoWidth="true" header="false"
			styleClass="k4-view">
			<layout:panel id="viewtoolbar" border="false" autoHeight="true" autoWidth="true"
				styleClass="k4-view-toolbar">
				<w:form groupId="form1">
					<w:toolBar>
						<w:button label="编辑"
							image="#{facesContext.externalContext.requestContextPath}/images/edit.gif"
							id="editCentralUnit" />
						<w:separator />
						<w:button label="删除"
							image="#{facesContext.externalContext.requestContextPath}/images/delete.gif"
							id="deleteCentralUnit" onclick="return deleteConfirm();" />
					</w:toolBar>
				</w:form>
			</layout:panel>
			<layout:panel title="搜索条件" border="false" autoHeight="true" autoWidth="true" collapsible="true"
				collapsed="false" styleClass="k4-view-search">
				<w:form>
					<layout:panelGrid columns="5" cellpadding="0" cellspacing="1" width="100%">
						<layout:cell styleClass="k4-form-fieldtitle">
							<h:outputLabel value="机构编号" for="code" />
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldvalue">
							<w:textField id="code" requiredTrim="true" jsvar="codeJsavr"></w:textField>
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldtitle">
							<h:outputLabel value="机构名称" for="unitName" />
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldvalue">
							<w:textField id="unitName" requiredTrim="true" jsvar="unitNameJsvar"></w:textField>
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldvalue">
							<layout:panelGrid columns="2" cellpadding="0" cellspacing="0">
								<w:button id="query" value="搜索"
									image="#{facesContext.externalContext.requestContextPath}/images/search.gif" />
								<w:button id="reset" value="重置"
									image="#{facesContext.externalContext.requestContextPath}/images/clear.gif"
									immediate="true" onclick="clearSeach();" />
							</layout:panelGrid>
						</layout:cell>
					</layout:panelGrid>
				</w:form>
			</layout:panel>
			<w:dataGrid id="centralUnitGrid" toolBarPosition="bottom" rows="10" paged="true" border="false"
				showRowNumber="true" styleClass="k4-view-datagrid" autoHeight="true"
				jsvar="centralUnitGridJsvar">
				<ajax:action event="ondblclick"
					action="#{system_centralUnitListBean.showCentralUnit}" />
				<!--<w:outputColumn width="60" align="center" clientFormatter="idFormatter" header="序号"></w:outputColumn>-->
				<w:outputColumn id="unitCode" header="机构编号" width="150"></w:outputColumn>
				<w:outputColumn id="name" header="机构名称" width="400"></w:outputColumn>
				<w:outputColumn id="parentCentralUnitId" header="上级机构" width="200" converter="orgNameFormatter"></w:outputColumn>
				<w:pagingToolbar for="centralUnitGrid" displayInfo="true" displayMsg="显示 {0} - {1}，共 {2} 条" />
			</w:dataGrid>
		</layout:panel>
	</w:page>
</f:view>